package com.zksk.admin.api.factory;

import com.zksk.admin.api.RemoteProductService;
import com.zksk.common.core.domain.R;
import com.zksk.mbg.admin.domain.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class RemoteProductFallbackFactory implements FallbackFactory<RemoteProductService>

    {
        private static final Logger log = LoggerFactory.getLogger(RemoteAdminFallbackFactory.class);

        @Override
        public RemoteProductService create(Throwable throwable)
        {
            log.error("系统模块调用失败:{}", throwable.getMessage());
            return new RemoteProductService()
            {
                @Override
                public R<Long> proReleaseDetails(Long id, String source) {
                    return null;
                }

                @Override
                public R<List<ProductRelease>> getListByCustomerId(Long customerId, String source) {
                    return null;
                }

                @Override
                public R<List<FieldSelect>> getListByOrgProductId(Long orgProductId, String source) {
                    return null;
                }

                @Override
                public R<Org> getOrgById(Long orgId, String source) {
                    return null;
                }

                @Override
                public R<OrgProduct> getOrgProduct(Long orgProductId, String source) {
                    return null;
                }

                @Override
                public R<List<Agreement>> getOrgAgreements(Long orgProductId, String source) {
                    return null;
                }

                @Override
                public R<List<Agreement>> getCustomerAgreements(Long customerProdReqId, String source) {
                    return null;
                }

            };
        }
    }
